package cn.boy.web.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.boy.service.StudentService;
import cn.boy.service.StudentServiceFactory;

public class SearchDormitoryMemberServlet extends HttpServlet {

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String no = request.getParameter("no");
		
		StudentServiceFactory instance = StudentServiceFactory.getInstance();
		StudentService service = instance.getStudentService();
		String json = service.queryStudentByDormitoryNO(no);
		System.out.println("student--->>" + json);
		response.getOutputStream().write(json.getBytes("UTF-8"));
		
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request, response);
	}

}
